<?php
class List_productModel extends Model{
	var $table_name='gaoji_product';
	function List_product(){
		parent::Model();
	}
	function getbestseller(){
		$this->db->limit(6);
		$this->db->where('bestseller',1);
		$data=$this->db->get('gaoji_product');
		return $data;
	}
	function getnew(){
		$this->db->limit(4);
		$this->db->order_by('productid','random');
		$data=$this->db->get('gaoji_product');
		return $data;
	}
		function getcuxiao(){
		$this->db->limit(3);
		$this->db->order_by('productid','random');
		$data=$this->db->get('gaoji_product');
		return $data;
	}
	function getContent($productid){
		$this->db->where('productid',$productid);
		$data=$this->db->get('gaoji_product');
		//print_r($data);exit;
		return $data;
	}

	function page($per_nums,$start_pos){
		//$this->db->select('title');
		$this->db->limit($per_nums,$start_pos);
		$query = $this->db->get('gaoji_product');
		$data= $query->result();
		//print_r($data);
		$datas['total_nums'] = $this->db->count_all($this->table_name);
		$datas[] = $data;
		//print_r($datas);
		return   $datas;
	}
}

?>